package com.kd.service.customer;

import com.kd.common.PageResult;
import com.kd.dao.CustomerMapper;
import com.kd.entity.Customer;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Service
public interface CustomerService {


    Customer findCustomerByPhone(String phone);
    boolean insert(Customer customer);
    Customer findCustomerById(Integer cid);
    Customer findCustomerById(String cid);
//    Integer getCidByCardid(String cardid);
    Integer getCidByphone(String phone);
    Integer getCidByemail(String email);
    List<Customer> findCustomerList();
    List<Customer> findCustomerListByName(String name);
    boolean updateCustomer(Customer customer);
//    int countByCondition(Map<String, Object> params);
//
// 添加基于游标的分页方法
    PageResult<Customer,Integer> findCustomerListByCursor(Integer cursor, Integer limit);
//    PageResult<Customer> findCustomerListByNameWithCursor(String name, Integer cursor, Integer limit);
    PageResult<Customer,Integer> findCustomerListWithFilters(
            Integer cursor,
            Integer limit,
            Integer cid,
            String name,
            String phone,
            String company,
            Boolean hasLicense
    );
//    public PageResult<Customer, String> findCustomerListWithFiltersandStats(
//            String cursor, Integer limit, Integer cid, String name,
//            String phone, String company, Boolean hasLicense,
//            Integer active_count, BigDecimal cce, Integer cpq,
//            String sortField, Boolean sortDesc);

    public PageResult<CustomerMapper.CustomerStats, Long> getCustomerStats(
            Long cursor,
            Integer limit,
            boolean isNextPage);
}
